A bunch of small fixes when building debian package