Fixing some bugs in compilation