fixes for joins and schemas