fixes bugs in percentage consistancy, fixes failing tests