Small fixes throught the code