BUG: loc was failing on integer slices (incorrect implementation), GH 3053

fixes #3053
see also #2904