Battery regulation