Fixing a crash-worthy bug