Prevent crash on nil statement
Replaced NSInteger with int

No need to use NSInteger if the functions we call only return int
Cast to keep the compiler happy
Release instance variables in owning class
Cast to keep the compiler happy
Print error if XML parsing fails