Fixes invalid array to string conversion