Fix compilation errors and tests to upgrade to elasticsearch 1.3.2