Fix for BHB in bag spam (ticket 226) (Not tested yet)

More code cleanup.