fix some build warnings and errors