Fabrice fixes

These 2 simple fixes are needed for the glTF project. 
note: both are tested.

@crazyjul can you review ? thanks ;).