Battery Friend: fix syntax and remove unused variables