fix incorrect comparison to find remaining block bytes