Add some tests to test for the bug the previous commit fixed