Fix mongodb to object transformation