Improved check before setting container to relative position. Fixes #119