Corrected bit manipulation in the Router. Added some corner cases in StorageManager.