Updated demo and added tests.