Moved scheme directory creation; fixed a bug with dynamic/static libs on Mac.