Fixed: Some ugly code has been changed.