Fix undefined index on $name
Merge pull request #958 from elliott-stocks/patch-2

Fix undefined index on $name