#15
fix #16 and minor fixes