fix tests and gcc compile