bugfixes to period editing.