Fix bug 1031485 - Prevent undefined variable access