Profit-taking by foreigners limits rebound; KOSDAQ ends in negative territory