Passes all VM tests
Fixed several bugs uncovered by the integration tests