Updated type casting for more ideal Swift style.
Fixed a few of the TODO's.