Fixes for GCC and Windows