Fixed 2 bugs in protocol_enforcer and changed main.c to make it easier
to test