Modified _slice() method to handle Windows line endings - fixes #22