Added shared schemes.
Some asserts - for safety.