Updated for Swift changes