fixed warnings when compiling with -Wall