Fixed small typeof(err) bug