Throw more IllegalArgumentExceptions
Fix and add some javadoc