corrected many errors, particulary demo files