Compilation bug fixes