fixed some minor problems in arduino sketch