Cool, I've fixed this and added a test!