Fix/repository bugs

OP ticket: https://www.openproject.org/issues/2129