Compilation fixes and code update