bug fixes to support windows