Fixed crashes introduced in [aee0317592c43b4fa6d9d84bc2e70968e4b93f5f]