A few bugfixes and smaller changes in Java code

Fixed a few bugs in jnipap and ojnipap. Indices were erroneous, a few
casts unnecessary and a smaller API change (references to a pool ID
was changed from 'pool' to 'pool_id' when referencing from a prefix
operation).
Merge branch 'fix_ojnipap'