Fixed possible nil error.