Octave 3.6 required a different kind of type check for me. Also, it didn't access the integer value of the Java object directly, so I made that access more explicit.