Fix build and build warnings