BUG: fixed peek() to work with frames smaller than requested size