Improve error-handling, e.g. using Tcl_SetErrorCode()