Fixed Arduino message handling codes