Fixed datagrid bugs