Added a new more hacky fixes to make plugin work.