Fix bugs in deploying modules from JSON.