nitg/niti: Fixed cast problem when using object_id on Bool and Char classes, added unit test

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>