Potential fix for #182

Also some prelude additions in here, but they're not relevant to the issue.