Fix compile time issues and place in debug code but nothing else