fixes #211

Seriously, we need to rewrite this to better fit in with the rest of our
code. For now this will do.