fix few bugs
fix bugs in compilation