Fixed bug in SMC resampling code.