Modified some functions in sage.c. >deving on w7