Add $(EXEEXT) to build-formats exe name
fix memory leak with format, meaning

check just before return at end of function