Fix #906, and do #914 while I'm in here (it wasn't too hard)