Containers and variables size arrays, plus fixes to importance sampling