fixes from richard