Fix percentage calculation
Fix unittests