Fix warnings and convert to XCTest