Fixed #597

Fixed broken joinType comparison and added fix from propel1 (https://github.com/propelorm/Propel/pull/641#issuecomment-35349789) as discussed here (https://github.com/propelorm/Propel2/issues/597).