Add autolayout code
Fix warnings