Fixes #521
rebased onto 68acd5298fa14df482c45f66f8206501e1f5d6f5
Looks good, thanks!
Pull-Request has been merged by pbokoc
Fixes #521