corrected small errors in joins