Fixing the resizing behaviour.