Misc fixes, work on hhvm