Reaplying this fix, it of course got lost while I rebased it on the current TWRP repository...

Change-Id: Ie3a57228064bf07f17777a1f05cd85fc2807a9c3