Make various fixes to the JOIN command