Bug fix in peripheral mapping