Hotfix with refinement and gaps bug.