changed the return value of some methods that have an output parameter to comply with apple's recommendations (and fix some static analyzer warnings)