fixed various issues: no static analysis errors