Credit goes to:

Dag Wieers for reporting bugs
Jan Engelhardt for submitting a patch that makes pam_shield much better
