Passes JoinOptimizerTest + QueryTest

Fixed a bug caused by getFieldName in Join being null