Reduced things to minimal cases so I could look at values in the debugger