various fixes from dave