fixes #2: fix forcing publishing of an existing module
#2: fix detaching an attachment