Code reformat, removed unnecessary checks, tiny fixes