Fix handling of home directory