Fixed some compilation bugs