Fix librepy* unit tests

Fixes ported to the current master from a private branch I forgot to push.