debianisms and some general fixes