Quantum behavior at a cusp, or how wave mechanics avoids a catastrophe