Adding changes to Idea and some tweak to types.