Bug fixes, clean up.