Fix issue #4, fix XPL bug