Improve handling of empty repositories