Remove nulls from data fields

I don't completey understand why, but a nullbyte is appened to whatever
the last field this function parses. A proper fix would probably be
to correct the stuff above to not include a null in the first place
but removing the nulls afterwards is okay too for now.