Fixed some cases of usage of bad programming techniques.