fix some problems that resulted from compiling in ANSI mode