Changes to support windows errors, incomplete