Adding tests for table_alias. Fixes #229