Fixed a nasty bug in the wolf cave script.

Kudos to Shirish for pointing that one.