small fixes to bag problem