fixed crashes when people were silly and used \r in their source, some little cleanups