Fixed instances method such that it accepts names

Previously, when invoked with `names` argument, the :instances method
was raising an exception `can't convert Symbol to Integer`. This patch
fixes this.
Merge pull request #1 from ptomulik/fix/instances_with_names

Fixed instances method such that it accepts names