Added a dofile to main.  Fixed some warnings.