Modified version of the patch from #4 Fixes #4 Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>