fix some build errors, check for compiler better