few small bug fixes