0.9.6 patch from main fork