Type check Collection#get arguments.

Fix #2922.