Added extra safety checking to aliased resampling mode
Fixed assertion checks in case of envelope loops on the last node