fix some runtime errors that appear on a real document