errors resolved

Several syntax and run-time errors are resolved.