Fixed bug and added utility scripts