Adding type-casting improvements