Improved Panel's layout mechanism.