Fixes #341

Turns out it was easier than I thought.