Implement the necessary exceptions for the Buffer and Lexicon.