TIKA-1446 - Apply fix of [~binhawking] and some cleanup