Resample bug fixed

Behaviour is now aligned with manual
Support for XMI-MSIM 2.1

May want to use some ifdefs later on to restore backwards compatibility
with 2.0