some clean and minor bug fixes