added upstart script and fixed minor errors