Bug fix: added new line char on writes
Bug fix: last message index