Some fixes to issue #80