Fixing windows issues.
Adding sampling.