Fix failing test cases

Fixes for a few failing or crashing test cases, and #349.

Sets the recommended warnings for Xcode 4.6.