Fixes error messages

Appends '\n' where it was missing and prints errors to stderr