Added base Exception class. Minor internal changes.