Removed RandomLib and fixed some bugs