even  more bug fixes this time serious ones

Signed-off-by: Spyros Gasteratos <morfeas3000@gmail.com>