Bug fixed when compiling with g++.