Removed obsolete buffer method.
Hardened buffer implementation with invariant assertions.