More unit tests and bugfixes for MMD kernel selection