Fixed some message handling