Issue #743: Do not append query string parameter if undefined. Throw err if param is required.