More manual adjustments and added requried imports to tex output so that it can be compiled standalone
Typo fix
Typo fix