A couple of fixes.

* better autocapitalize behavior
* fixed crash related to autoperiod