Make RESOLVE(statement) correctly handle any keyword. Fixes #1242.