misc minor fixes

replaces #21

@pavelgj could this be merged ?