Fix `Undefined index` error. Closes #117