Fix a couple of crashes: bad JNI ref for enum, API level snafu.