I should have scrolled down to your comment first! I spent 10 minutes debugging.
Nice work GP if that was air-coded, though.