More code cleaning to remove PHP warnings