fix compilation bugs