better error message and fixed failing test