Ticket #3341 Added conditional check which caused issue on windows when
cleaning up.