Bug fix in calculating preditciton sets