Datasource fixes

Fixed some quick problems so that the datasource is somewhat functional.