fixing compilation bugs