fixed fifi utils and added region unit test using random data