Correct handling of NAs by EM - fixes #42