A script fix has also been developed to address this issue. It is attached to this Knowledgebase article. This fix is compatible with all 4.0 Service Packs. The instructions for application are as follows:
1) Run each of the SQL scripts against the DB
2) Go to [site root]\browser\htmlforms\mapping and make a backup of the MapPageCustomMetadata html and js files.
3) Copy the MapPageCustomMetadata html and js files from the script fix into this directory.