Fix warning: case value '0' not in enumerated type.
Fix warning: narrowing conversion inside { } is ill-formed in C++11.
Fix warning: proper cast.