Fix some style errors

Overwriting `match` makes me nervous, since you use `match` to mean one thing above but another thing below. Shouldn't you give this a different name?