catched NPEs in OpenSearchModule (fixes #23 and fixes #18) and cleaned
up source format