Fixed some more runtime errors