error fixes and modifications