Some improved message handling