Fix some issue pointed out by bochecha