add capitalize patch from Tong Sun (code and tests)