Ill-posedness for nonlinear Schrodinger and wave equations