Added battery test logic.