fixed file modes
Moved remaining messages out of plain source