Implemented changes from Lanyon fork

See my fork at github.com/tummychow/lanyon for details.