Fix warning & errors derived from old swift code