Fixed shuffling test.
Removed unused code.
Fixing some file ops