If you've "index by binary_integer" you'd better declare j as binary_integer!