This explodes with an obscure error if colon == -1. Instead handle that case explicitly