update serial with p5 code conventions, fix two warnings