More elegant fix from 13b261c8813c70c42e23ebd6ff1a42d46e11ba3a