fix potential NPE
better doc's version handling
more and more tests passing
fix more ES test suite