Structure changes, fix message sending, fix other bugs.