Feature emval improvements

As discussed in issue #2925, here is the proposed patch for discussed improvements.

Let's shoot remarks ;-)
Is there any reason for this to return EM_VAL instead of bool?