Fix exploitPrevention() and add Javadocs