PHP: Fixing bugs allover the place