Fixed JPReader bug and added tests to cover it.