Fixed bug caused by reading header only files, rearranged code for clarity.
Fixed bug caused by reading header only files, rearranged code for clarity.

cancerit/CaVEMan,cancerit/CaVEMan,cancerit/CaVEMan