This patch fixes both bugs. The first problem was spotted and initial
patch submitted by Dave Jones <davej@redhat.com>. The second problem
was mentioned and fixed by Jeff Garzik <jgarzik@pobox.com> in a larger
cleanup patch.
Cc: Dave Jones <davej@redhat.com> Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Tejun Heo <htejun@gmail.com>