Issue #647, fix newline handling edge case.

You're right, I am still figuring out this typing stuff. I got hdevtools integrated into vim so I should be able to move around and figure things out a little more quickly.