Use 'long', not 'int', to determine bpval.
Fix use of '%' in format string.