Manually applied 1.6.18 patch to version 1.6.21