Some errors handling + comments