Fixed PHP bug and wrote comment to explain.
Deleted unnecessary files.