Apex integration

Minor adjustments to remove warnings and make it compile with gcc again