Bug fixes for OData 

Fixes #1889 and #1893