Fixed the junction issue and added more debug/logging info