fixes for repair/rebuild functionality.
more to come.