bug fixes and a few small new things