bug fixes
properly working nested join

Signed-off-by: gmyx <gmyx@gpws.ca>