Added refresh control and included bug fixes