Add back the options to force building of packages.
Make code more resilient to errors and fix error.