tests and subsequent fixes