Fixing active bundles protection. Adding tests.