Added an if-statement to prevent a crash.

Also changed a few small things like replacing the "normal" enum with NS_ENUM.