and some fixes