Added a demo class and exception bug fixes