Fixing crashes on char assignment