Cutoff and lattice effects in the theory of confined systems