Fixed default casting for undefined, added fieldName to cast function, added setting of failedCasts in case casting fails, fixed erorr where default didn't check if valua BEFORE casting was undefined, added missing typeof