Fix indentation. Check for undefined variable to prevent exception.