Replaced most scalar code with NEON implementation. Got the same wrong results as before unfortunately.