Fix error on upgrading from pre-engine app. Fixes #1280.