diff --git a/src/parsers/ch.c b/src/parsers/ch.c
index 8b67744e16aebe1325faaea4b2d130f819026277..1f6526a57de6a5808e2b4467cdc77aaf19ab95e3 100644
--- a/src/parsers/ch.c
+++ b/src/parsers/ch.c
@@ -12,10 +12,18 @@ static HParseResult* parse_ch(void* env, HParseState *state) {
   }
 }
 
+static bool ch_ctrvm(HRVMProg *prog, void* env) {
+  uint8_t c = (uint8_t)(unsigned long)(env);
+  h_rvm_insert_insn(prog, RVM_MATCH, c & c << 8);
+  h_rvm_insert_insn(prog, RVM_STEP, 0);
+  return true;
+}
+
 static const HParserVtable ch_vt = {
   .parse = parse_ch,
   .isValidRegular = h_true,
   .isValidCF = h_true,
+  .compile_to_rvm = ch_ctrvm,
 };
 
 const HParser* h_ch(const uint8_t c) {
diff --git a/src/parsers/optional.c b/src/parsers/optional.c
index 3d3e9f6ac9d82cea49d6d20bf038442c80fa5f9b..203d4a7f958f0cb2db953f161d07ff89799dd5e0 100644
--- a/src/parsers/optional.c
+++ b/src/parsers/optional.c
@@ -21,9 +21,10 @@ static bool opt_isValidCF(void *env) {
   return p->vtable->isValidCF(p->env);
 }
 
-static bool opt_ctrvm(struct HRVMProg_ *prog, void* env) {
+static bool opt_ctrvm(HRVMProg *prog, void* env) {
   uint16_t insn = h_rvm_insert_insn(prog, RVM_FORK, 0);
-  if (!h_compile_regex(prog, (HParser*)env->env))
+  HParser *p = (HParser*) env;
+  if (!h_compile_regex(prog, p->env))
     return false;
   h_rvm_patch_arg(prog, insn, h_rvm_get_ip(prog));
   return true;
@@ -33,7 +34,7 @@ static const HParserVtable optional_vt = {
   .parse = parse_optional,
   .isValidRegular = opt_isValidRegular,
   .isValidCF = opt_isValidCF,
-  .compile_to_rvm = opt_ctvrm,
+  .compile_to_rvm = opt_ctrvm,
 };
 
 const HParser* h_optional(const HParser* p) {