Some fixes to #21