Remove debug, update phpDoc and small code cleanup