Fix php bugs and modify a few styles