Add test for previous commit and fix bug