Updated for latest swift changes