remove inline keywords (caused CLANG errors on Travis)
Fixed two memory leaks