Fixed issue #2 in a cross-platform way