Some minor fixes for the VM code