bugfixes to mapping