Fix a bug in `expand` by restricting the statusCode to 301. Add logging.