Matrix multiplication error, followed by wrong logging etc. Fixed the first few errors but grew tired of debugging