Return correct column type on querying. Add tests for the same