Some cleanup and improvments.