Validates enum in getnum() and gives proper error