Porting Bug fixes.

Corresponding fix.

https://github.com/mtgibbs/NapkinTour/commit/bdef27c15fe4b6e648239b2719ca6af591c53ac2