Fixing a crash due to a wrong object being passed.