Fix bugs in Ubuntu