Fix for issue 267, from Paul Felix