Making code more script friendly (Throw Exception vs die) and avoiding infinite loops.