Fix a runtime error in DarkCastle