bug fixes from Drew