Fix error 'cannot refer to other statics by value'
Fix warnings