Prevent segfault with no input data
Windows related changes