Thought I had fixed the bug, but didn't. This should fix it