Added checks to return values of remaining windows functions.