A few changes to get the script working with newer ubuntu