Fix various potential problems.
Fix various potential problems.

FRC900/2016VisionCode,FRC900/2016VisionCode,FRC900/2016VisionCode,FRC900/2016VisionCode,FRC900/2016VisionCode,FRC900/2016VisionCode,FRC900/2016VisionCode