Minor refactoring and bugfixing with g++-4.8.