Bug fix related to #155 & #177; table was joined twice