some changes to make compilation under mac possible