Fix an error which prevent program exiting under normal circunstances