a few small bug fixes and some other stuff