assorted bug fixes from testing