Fixed issues 14, 16 and 20, along with a few minor issues