ASN.1 bug fixes and additions

This patch fixes a few bugs (crashes) and adds basic support for constructed elements and teletex strings.