fixed NPE;
added a manual extraction command line tool