de-globalized beginpnum
fixed minor endpnum argument check (not sure if it actually ever occurs though)