Merged fix for Puppet 3.0 and HOME env variable from gergnz/master