Fixing nil dereference.