Fix the types for scopes/indexes

See https://github.com/strongloop/loopback/issues/562