Fix bug and fix compile error in linux