Some more code fixes