bug fixes for all, testing required