Improve join creation #666