Some cleanups and one bug removed. The size of the sf.weight was too small. usually no problem but could lead to a seg fault