Issue #2149599 by Wim Leers: Fix minor bugs and minor coding standards violations in edit.module, discovered by backporting.