Rework automatic actions. Fixes #106.