Changing non-nested object mapping to nested should fail

Fixes #2518