Fix stack overflow caused during scroll view delegate callbacks
Document delegate setting
mostly code style improvements