fixed some HHVM bugs

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

This is a workaround for facebook/hhvm#1161. I made the change as the workaround does the same thing and the eval is part of unit tests.