Fixed a bug that could cause splitting issues

This was fixed by adding a while loop that add the missing data if the
line didn't end on on '\n' (New line).

Tags: [BUGFIX]