Added check for bad ranks in proc.