Add fixes to make it more compatible with Ubuntu.