Fix bugs 9 and 14