fix failing tests and regression