Fixes bug 998473 cast build_type to enum instead of name type