Added logic to only set $HOME on puppet 3+.