Fixed an issue where reading in a file would cause extra or less new line characters.
Fixed a bug that could cause an NPE exception.