minimal test; array out of index, NPE fixes