Really fix this ...
diff --git a/system/core/Output.php b/system/core/Output.php
index 69a2e5f..d27133d 100755
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -396,8 +396,9 @@
 
 			// If the output data contains closing </body> and </html> tags
 			// we will remove them and add them back after we insert the profile data
-			$output = preg_replace('|</body>.*?</html>|is', '', $output, $count).$CI->profiler->run();
-			if (isset($count) && $count > 0)
+			$count = 0;
+			$output = preg_replace('|</body>.*?</html>|is', '', $output, -1, $count).$CI->profiler->run();
+			if ($count > 0)
 			{
 				$output .= '</body></html>';
 			}