Fix typehinting and made objectval a trait