Fixed mg_connect() call