Fix a user bug and add testing for it