Fixed several runtime errors