Do not use type class instances which are not exported

Fixes #594 

And maybe also the other bug, not sure....

@garyb Mind reviewing this one, please?