Safer upgrade process. Closes #206