Fixing compilation on Linux.
Adding region to mask function.