[xcode 5.1] Fixed compiler errors

Also added some documentation