Fixed compile bugs and merge fail resolution