Bunch of fixes for Ubuntu