various error fixes