fixed bug where script imported with empty metadata would cause errors