Added messages and fixed some bugs