Another bunch of minor fixes
Merge pull request #415 from anton-rudeshko/fixes

Another bunch of minor fixes