Fix primitive type detection