Add missing test conditions to test_repository_lib.py and minor edits to modules