master: Clean up and bug fixes from testing.