I found the problem in the
check_comment function of
$number = count($all_links); should be
$number = count($all_links);
and the count code should be before the spam words test. I went ahead and rewrote
check_comment function a little. You can read about it and the other anti-spam measures that I took here:
This is what I get for getting permalinks working!!!