Make it really work with modules - fixes #4