Updates for the debian branch

Hi, Luke.

Can you please merge these changes to your Debian branch (only to that branch, don't mix this with your master branch) and see if I didn't make any gross mistakes?

Thanks.