Fix file transfer failure and refactor test

This pull request fixes #105, file transfer eventually fails due to division by zero error. Also refactors the test of progress monitor.