reverted layernum change

and dylib link fixes