Added an if-statement to prevent a crash.

Also changed a few small things like replacing the "normal" enum with NS_ENUM.
Merge pull request #1 from marcelvoss/master

Added an if-statement to prevent a crash.