Added support for Ubuntu, fixed minor bugs in a few variable references