Fix compiler warnings and use PHP coding style