Fix _takeBytes bounds check