fix match and return Option<uint>