We study the computational complexity of several decision problems (including the emptiness, disjointness, finiteness, and containment problems) for various restrictions of two-way reversal-bounded multicounter machines (2NCM). We then apply the results to some problems in coding theory. We examine generalizations of various types of codes with marginal errors; for example, a language L is k-infix-free (k >= 0) if there is no non-empty string y in L that is an infix of more than k strings in L-{y}. This allows for bounded error versus standard infix-free languages. We show that it is PSPACE-complete to decide, given k and a 2NCM M whose input is finite-crossing, whether L(M) is not k-infix-free. It follows that the problem is also PSPACE-complete for one-way nondeterministic and deterministic finite automata (even for the two-way models), answering an open question in [12]. We also look at the complexity of the problem for restricted models of 2NCM and for other types of codes, and improve/generalize some previous results.