Bugfixing and added extra functionality for message handler.

Added more fields to msg struct type. This yield the opportunity to
send more specific messages.