bug fixed to work on Ubuntu 13.10 with GCC 4.8.1