Fix for when including this in node using AMD

module will be undefined, so need another check.