Bug fixes and new scripts