fixed bug in clpmn violating array bounds