Add tests and fix rsync module for tests