Small fixes

Fix quote logic in serialize data. Fix alt trim function.