Fixing several issues in libraries found on a real example in main.
@rev gtorres@
@bug W-2328663@
Merging origin/gtorres/master-pending-libfix into master