Back end: Fixed null pointer exception for the message callback. Resolves #158, #106, #55, resolves #123.