minor code changes and demo setting improvements