Fix a few issues in the html reading/writing (just enough to fix crashes, plan to move towards the native conversions).