minor bugfixing and some changes