Reverted changes of 2bec0ae1211c89990ee63f364582349495b7fdc6 to fix some problems with this commit.