fixes #126, #124
Merge pull request #127 from guybedford/master

fixes #126, #124