Update tests and implement correct behaviour