imported bug fixes for pdf417 from java version