Fixes #213 (and others)