Fix the refactor changes. Seems to fix the problem, but I do not know why