Refactored code for ARC

I removed the autoreleases of objects (I think this should work) and
then ran the ARC refactorer in Xcode 4.
Added proper casting of Ints to UInt32 + dealloc

Added proper casting of Ints to UInt32 + I seamed to have forgotten to
delete the dealloc sections in the code so this have been done now.
Fix compiler warnings.