made some fixes according to comments on github