REL-2005: Code cleanup and inform user if something goes wrong.