can: add limit for nframes and clean up signed/unsigned variables