Fix #893 (creating first repo with negative priority)