fixes to sg-loader