fixes for Swift 1.0