Properly encode IMPLICIT tag

Implicit tags are once again broken for submodels.

This patch fixes both incorrect encoding and broken code.