HHVM compatibility

This PR aims to solve the HHVM issues reported by running the testsuite on Travis