Fixed tests.
Converted to modern Objective-C syntax.
Fixed type casting for building for 64-bit architecture.