Fixed issues with Arduino code and updated test bash script