Fixed signed-ness issue (0xff != -1) for motor check