small fixes for windows compiler
SSE config fixes
reorder functions to avoid forward references