Added zeroing memory after allocation of layers in hope of getting read of mem problem