applied patch from Michael Meeks

Change-Id: I57f22b6d9bfbef4a50d162076b01e8e64edb4718