fixes a bunch of arduino bugsrelated to serial read