Clean up & bug fix