Added debugging and fixes for incorrect messages