Wrap assert checks in isset() to prevent warnings