Issue 514

Fixes #514