Fixed several bugs and cleaned up code in controller for file Queuing and generating MACs