Fixed an inalid write (maybe). Committing again for more debugging.