Fix possible error with invalid theme file