Move ParsePrefix into common code. #116