Fixed bugs, added Integrity flags feature.