made criteria optional on join nodes

Made the criteria optional as it wasn't being checked whether it was there or not, producing an exception on empty criteria queries.