fixed few PHP warnings

discovered while working on https://github.com/GigaOM/legacy-pro/issues/4125