#888: Fix undefined index errors. Thanks, Visman.