Join Condition Bug Fixes and other minor improvement.

Join Condition Bug Fixes and other minor improvement.