Removed debugging code
Added sanity checks for empty matrices during nifiti read and trial averaging