Made autocopy executable and fixed a bug