Tons of bug fixes and preparations for KI