Added file id generation test and fixed bug