Modified to prevent generation of PHP notice.