improved the search of environment variables for HOME
fixed issue #12