Enable debug mode. Fix undefined index and undefined variable issues.