Fixes to TableQueryResult.asDataFrame() and unit test