Protocols And Applications For Imperfect Quantum Devices