Some cleanup using Apache string functions.