Fixes an issue with newlines being counted twice. Fixes #41.