Judge orders study of terror defendants before sentencing