odatagen: Fix semantic issue and removed unused var