Fix bugs in ubuntu