Add isset check to fix failing tests