diff --git a/lib/Boris/ShallowParser.php b/lib/Boris/ShallowParser.php
index <HASH>..<HASH> 100644
--- a/lib/Boris/ShallowParser.php
+++ b/lib/Boris/ShallowParser.php
@@ -207,7 +207,7 @@ class Boris_ShallowParser {
   }
 
   private function _prepareDebugStmt($input) {
-    if ($this->_isReturnable($input) && !preg_match('/\s*return/i', $input)) {
+    if ($this->_isReturnable($input) && !preg_match('/^\s*return/i', $input)) {
       $input = sprintf('return %s', $input);
     }
Fix issue with regex for return statements