Extract line end character to DEFINE directive
Add some debug printing