Fix topic parsing
Apply fixes to prevent memory issues