Clean up and bug fix...