Fixed compile error with clang.
Changed size_t to 'unsigned long'
Merge pull request #1263 from Howaner/GlobalFixes

Fixed compile error with clang.