Add some error fixes