fixed stuff related to stdio and mem*, added ungetc