Fix comment and old copyOfRange issue, add some array length asserts.