Move checking of alias to table function
Merge pull request #324 from wilsonge/tabletype

Move checking of alias to table function