Added more explicit error message for failing to open a window