fix whereValue types

Dictionary<any> was ruining type inference
The new type of <W, T extends W>
is more exact and does not mess up inference