Fix Windows console text color problems (now initial text color is preserved)
Fix dynamic linking problem on OS X