clean up some minor bugs