#4137 Fixing runtime errors