various fixes from Mike N