Cleaning up php errors