repair: Try to fix some corner cases