5.5 and cleanup

Fixes 5.5 compatibility and some phpdoc.