Added additional checks to ensure join mapping is valid