Fixes #475 courtesy and work  of @baalhiverne (I am just committing) - thanks!