windows bug fixes; couple of edge cases