Merge PR #548 and #549 

https://www.pivotaltracker.com/story/show/80874156
https://www.pivotaltracker.com/story/show/80874184