Sample rebuild mechanism.
Fixed if statements.
Merge branch 'QuickRebuild'