Fixed a bug in OS if block