Fixed heap corruption in log formatting. Wrote some more tests. Binary streams are OK, message queue needs work.