Applied patch by nathanmccloskey