Merged EAP 5.2 related changes from branch v2.1.5.Final and upstream/master.