Fixed the real issue behind the crashing.