Write tests fixes