fix issue when key or value contains \t

Whitespaces are now trimmed at the beginning and end of keys and values.