Update debug/debug.php

Added debugging for all functions that can output errors.