Fix compatibility issues with GCC 4.6. Closes #2