Added some debugging.
Bugfix: cast current and max to float before calculating percent.