Corrected a module function reference mistake

Change-Id: I48a1b0c9b87303e8d5191550f0dd9542096b3536
Made some cross-platform improvements

Change-Id: Ie108efb003eace21958eb23ed7a3a5344ecceb7f