fixed compilation bugs