Fix a few leaks and add a help method.