Fixed errors based on VM testing.