Remove trailing spaces
Allow root directory to be overridden via environment variable