diff --git a/compiler2/record.c b/compiler2/record.c
index 4ea1a3faf1df9971a15ef4129d326a1a83059ead..9550b1b21b787e6b6ca6d880f9313a8b542dcda5 100644
--- a/compiler2/record.c
+++ b/compiler2/record.c
@@ -4786,14 +4786,14 @@ void defRecordClass1(const struct_def *sdef, output_struct *output)
       "  }\n"
       "  if(p_td.text->end_decode){\n"
       "    int tl;\n"
-          "      if((tl=p_td.text->end_decode->match_begin(p_buf))<0){\n"
-      "          if(no_err)return -1;\n"
-      "          TTCN_EncDec_ErrorContext::error"
+      "    if((tl=p_td.text->end_decode->match_begin(p_buf))<0){\n"
+      "      if(no_err)return -1;\n"
+      "      TTCN_EncDec_ErrorContext::error"
       "(TTCN_EncDec::ET_TOKEN_ERR, \"The specified token '%s'"
       " not found for '%s': \",(const char*)*(p_td.text->end_decode)"
       ",p_td.name);\n"
-      "          return decoded_length;\n"
-      "        }\n"
+      "      return decoded_length;\n"
+      "    }\n"
       "    decoded_length+=tl;\n"
       "    p_buf.increase_pos(tl);\n"
       "  }\n"