Fix issue 540