fix for am/pm lengths != 2