Solved issue with multiple joins not working correctly.