Fixes #142 for the most part.