Fix ticket 30 and 31