fix primitive type handling