Fix warning and error when build on Ubuntu