Bug fixes, added remove script function