fixes for hhvm unexpected behavior