diff --git a/include/class.ticket.php b/include/class.ticket.php
index 417e7be770e7a85a5b2a881a8667ba6d6ee72ade..7cbc22ce9cd02bfa72a0454acab03113199b1855 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -3696,7 +3696,7 @@ extends VerySimpleModel {
         'pk' => array('ticket_id'),
         'joins' => array(
             'ticket' => array(
-                'constraint' => array('ticket_id' => 'TicketModel.ticket_id'),
+                'constraint' => array('ticket_id' => 'Ticket.ticket_id'),
             ),
         )
     );
diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php
index eb4dee649ab2f1b52d53e64e73bc4204ee3f1d21..675e996428a04f4f242a5b3799322ebbcaea4aa1 100644
--- a/include/staff/ticket-view.inc.php
+++ b/include/staff/ticket-view.inc.php
@@ -206,7 +206,7 @@ if($ticket->isOverdue())
               </ul>
             </div>
                 <?php
-                if ($role->hasPerm(TicketModel::PERM_REPLY)) { ?>
+                if ($role->hasPerm(Ticket::PERM_REPLY)) { ?>
                 <a href="#post-reply" class="post-response action-button"
                 data-placement="bottom" data-toggle="tooltip"
                 title="<?php echo __('Post Reply'); ?>"><i class="icon-mail-reply"></i></a>