Add more error checking to put.