This is the bug I was talking about in the pull request. Might be a better way around it by fixing the code below?