Fixing sleepy mistake caught by unit test

Just goes to show why unit testing is so good. Catches stupid mistakes