Fixed some warnings when compiling using -O2