Fix bugs in include handling. Add a way to print error messages.