Fixed Linux compatibility for cleanup