diff --git a/ajax.php b/ajax.php
index 71f9494de657afa8446d2143e4e4d3d5090ca18b..b40869292b81680ad136b9365793c616e0b0c3bb 100644
--- a/ajax.php
+++ b/ajax.php
@@ -21,7 +21,7 @@ function clientLoginPage($msg='Unauthorized') {
 
 require('client.inc.php');
 
-if(!defined('INCLUDE_DIR'))	Http::response(500,'config error');
+if(!defined('INCLUDE_DIR'))	Http::response(500, 'Server configuration error');
 require_once INCLUDE_DIR.'/class.dispatcher.php';
 require_once INCLUDE_DIR.'/class.ajax.php';
 
diff --git a/api/pipe.php b/api/pipe.php
index b1835a88fd722a47005de9951975375077149c85..29dfcff1d1aa10a20386589927830ffed8211911 100644
--- a/api/pipe.php
+++ b/api/pipe.php
@@ -115,7 +115,7 @@ if(!$ticket) { //New tickets...
 }
 //Ticket created...save attachments if enabled.
 if($cfg->allowEmailAttachments() && ($attachments=$parser->getAttachments())) {
-    foreach($attachments as $k=>$attachment) {
+    foreach($attachments as $attachment) {
         if($attachment['filename'] && $ost->isFileTypeAllowed($attachment['filename']))
             $ticket->saveAttachment(array('name' => $attachment['filename'], 'data' => $attachment['body']), $msgid, 'M');
     }
diff --git a/include/class.faq.php b/include/class.faq.php
index 06be159044c337cb9c102c7864edf0445c8d08be..2197bbac102604d334d2f59b71d7658a3b18b39b 100644
--- a/include/class.faq.php
+++ b/include/class.faq.php
@@ -135,7 +135,7 @@ class FAQ {
 
         if($ids) {
             $topics = $this->getHelpTopicsIds();
-            foreach($ids as $k=>$id) {
+            foreach($ids as $id) {
                 if($topics && in_array($id,$topics)) continue;
                 $sql='INSERT IGNORE INTO '.FAQ_TOPIC_TABLE
                     .' SET faq_id='.db_input($this->getId())
@@ -163,7 +163,7 @@ class FAQ {
         //Delete removed attachments.
         $keepers = $vars['files']?$vars['files']:array();
         if(($attachments = $this->getAttachments())) {
-            foreach($attachments as $k=>$file) {
+            foreach($attachments as $file) {
                 if($file['id'] && !in_array($file['id'], $keepers))
                     $this->deleteAttachment($file['id']);
             }
diff --git a/include/class.osticket.php b/include/class.osticket.php
index e6f34740ee0e45c882b100009ca818f070d07fce..033ec0f82accf22a97b855b39c12c4166fe580af 100644
--- a/include/class.osticket.php
+++ b/include/class.osticket.php
@@ -138,8 +138,8 @@ class osTicket {
             if(!$this->isFileTypeAllowed($file))
                 $file['error']='Invalid file type for '.$file['name'];
             elseif($file['size']>$this->getConfig()->getMaxFileSize())
-                $file['error']=sprintf('File (%s) is too big. Maximum of %s bytes allowed',
-                        $file['name'], $this->getConfig()->getMaxFileSize());
+                $file['error']=sprintf('File (%s) is too big. Maximum of %s allowed',
+                        $file['name'], Format::file_size($this->getConfig()->getMaxFileSize()));
             elseif(!$file['error'] && !is_uploaded_file($file['tmp_name']))
                 $file['error']='Invalid or bad upload POST';
 
diff --git a/include/class.ticket.php b/include/class.ticket.php
index 8eb5399ce31ce60d177f5e4fce002b9d26dfc19c..b9da90052c735f1b38943c83636b38aa2800f671 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -1412,11 +1412,11 @@ class Ticket{
         $attachments = array();
         //Web based upload.. note that we're not "validating" attachments on response.
         if($_FILES['attachments'] && ($files=Format::files($_FILES['attachments'])))
-            $attachments=array_merge($attachments, $this->uploadAttachments($files, $respId,'R'));
+            $attachments=$this->uploadAttachments($files, $respId, 'R');
 
         //Canned attachments...
         if($vars['cannedattachments'] && is_array($vars['cannedattachments'])) {
-            foreach($vars['cannedattachments'] as $k =>$fileId)
+            foreach($vars['cannedattachments'] as $fileId)
                 if($fileId && $this->saveAttachment($fileId, $respId, 'R'))
                     $attachments[] = $fileId;
         }
diff --git a/scp/ajax.php b/scp/ajax.php
index 22f00f1376765fdb1f36d424e816ca468650dbff..259413dab83034c23c52ca5e6017bf9b5d9b9719 100644
--- a/scp/ajax.php
+++ b/scp/ajax.php
@@ -28,7 +28,7 @@ ini_set('display_errors','0'); //Disable error display
 ini_set('display_startup_errors','0');
 
 //TODO: disable direct access via the browser? i,e All request must have REFER? 
-if(!defined('INCLUDE_DIR'))	Http::response(500,'config error');
+if(!defined('INCLUDE_DIR'))	Http::response(500, 'Server configuration error');
 
 require_once INCLUDE_DIR.'/class.dispatcher.php';
 require_once INCLUDE_DIR.'/class.ajax.php';