Fixed Erros and warnings