Fixed incorrect handling for non-string types.