Bug fixes and working refresh