Fixed bug in PSO implementation.