Changed the JOIN type in certain statements

Changed them from OUTER JOIN to INTER JOIN, because OUTER JOIN returns
nulls for data that doesn't exist on both sides