bug fixes from stress test