Fixed more PHP error handling changes after testing