Some fixes and a printf implenentation