Bug fix for change bg/costume, reset sprite before running, change rotate calculation