Fix for issue #9, so it is now compatible with XE 17.2, also fixes issue #2