Adding Safe Exit and safe unload
Merge branch 'master' of https://github.com/victorcabeceira/TECPROG_2-2014