Added repo field
Updated tests
Code clean-up, small bugs.