Terminate string properly