Renamed ECCastTo macro and fixed an error when objects were nil.