Improvements to join functionality, add debug message