fixed nasty bugs created by using svg cleaner and miscellaneous fixes and improvements