Forward port from MSU fixes

Fixes issues: #8, #9 and #10