improve and simplify errors (TODO: win32)