Added debugging lines, fixed subject index population issue.