Fixed snl.cpp and small changes in join.cpp