Many fixes and some style conformity changes