Fixed errors in demo (issue #18)