small changes and some fixes