Fix for #299.

Ok, third time lucky for issue #299. A clean commit targeted against ```develop```. Let  me know if this works for you.