 		(ledger-fontify-set-face (list (match-beginning 4) (match-end 4))
 														 (cond ((eq state 'cleared)
 																		'ledger-font-posting-amount-cleared-face)
-																	 ((eq state 'cleared)
+																	 ((eq state 'pending)
 																		'ledger-font-posting-amount-pending-face)
 																	 (t
 																		'ledger-font-posting-amount-face)))

  :group 'ledger)

(defun ledger-fontify-buffer-part (&optional beg end len)
	;; (message (concat "ledger-fontify-buffer-part: ("
	;; 										 (int-to-string beg) ", "
	;; 										 (int-to-string end)
	;; 										 ")"))
	(save-excursion
		(unless beg (setq beg (point-min)))
		(unless end (setq end (point-max)))

	(save-excursion
		(ledger-fontify-xact-start (car extents))
		(while (< (point) (cadr extents))
			(if (looking-at "[ \t]+;")
					(ledger-fontify-set-face (list (point) (progn
																									 (end-of-line)
																									 (point))) 'ledger-font-comment-face)
				(ledger-fontify-posting (point)))
			(forward-line))))

(defun ledger-fontify-xact-start (pos)
	"POS should be at the beginning of a line starting an xact.
Fontify the first line of an xact"
	(goto-char pos)
	(beginning-of-line)
	(let ((state nil))
