Fix various (but not all) problems reported by Benjamin on Nix::Platform upstream patch.

Reviewed by: Lauro Neto