Fix behavior for unit tests