fix processing of long values