Added setType declarations and defined missing var