Fixed some missing debian dependencies and a bug or two