Added casts to supress varargs warnings