Some new help functions, some cleanup.