Fix for tag fallback and double environment variables