Fixed loader code to compile better on GCC
Merge branch 'bugfix-loader-gcc'