Fix code style and PHP Doc for several functions