Further logging and general cleanup