Code cleanup. Fixed PHP warnings