#17 fixed and minor fixes