Fixed minor bugs when sensors are unplugged