im fields

Fixes #1391

Yes, I tried to use the old PR but the patch file had too many issues and there was no branch to cherry-pick the commits from.