Some fixes

First bugs fixed