Many bugfixes, but IV still not being passed correctly