Fixed itemmap calls where handling empty string. Tidied up sharedata a little