Some general fixes