Resolving crippling slowdown introduced by bug fix