Fix some warnings.
Replace dynamic invokation of extension functions. Call delegates statically instead.
Remove if-statement with condition that is always true.