- added some casting of primitive values