make tail=num work correctly, adds to #77