Tons of fixes to get visibility-2d working.