further cosmetic changes and some bug fixes