Fixed bugs that caused board to reset