Cleanup and a bugfix.