fixup! Bug #5856. Unit tests and fix mistake in ESR31 port