remove some warnings and deprecated methods
cast explicitly an enum value to remove warning
add comment about wanted static analyser error