General fixing and clean up