Added tests for memory management and brought the tests back to work for Xcode 6