Added -g option to rebuild script.