Fixed some timing stuff and added Arduino reset