Fixed initializing animate with an undefined element causing the script to fail.