fixes for swift 1.0