Adaptation and iOS compatibility 7. Many of BUG fixes