various bug fixes from recent update