Improvements to type system

https://www.pivotaltracker.com/story/show/62505836