Clean-up and compile fixes