fix some errors during building thanks erikcas