fixed some compilation bugs