Added return value to "attach" method; Fixed issue with component insertion.