some fixes as discussed on github