And add some tests for this situation.