Update functions.inc.php

Changed 404 and 500 Controller variables so that original $controller variable is available for logging or debugging.