errors now go to stderr
fixed clang errors
fixed clang errors