Fixed compilation problems on GCC 4.4.

- 'typename' used outside template scope
- suffix d for double problematic
- removed external linkage from scheduler