Use C++ allocation style, not C
Fix invert function