AutomationPattern: fix values after last value

Fixes #325

Also, in one method I found a polite request to "improve this" so I did.