Edit based on abenari's commit.