Fixed issue #1733 and associated unit tests

Solves the problem of programmatically enabling pinning without giving a size to the width. Corrected the unit tests that where affected by the changes.