Address lintian warnings and copy the OS environment before altering

Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>