added defensive code around last set bit in MiruFilterUtils