added -Wextra compiler option and fixed warnings