Respect rebuild option

I found that the rebuild option did not do anything. This is just to actually use it.