Fixed bug with sending message from file
Fixed portability issues
Fixed some cosmetic issues