Correct cross-platform clearing

Fixed platform dependent clearing by added DoS and Windows system calls.