Beautify and lint along with minor fixes.