Fixed 'Release'-build-specific type cast crash