Fixes to #158