Tests, demo and fixes