fix some compilation bugs