Moved the (very central) function GetLastError() to main.c and fixed and moved its (very central) prototype to sysdeps.h.