Fixed #1112

Did as proposed by @whit537