Battery simulation bugs fixed, only the leakage test still fails