Changes needed for the sparrow3d changes + bugfixes