Updated code to work with Swift Beta 5.