Bug fixes in get_voltage()