add TestThrowable.java
fix a bunch of corner cases around array type checking