Here's a revised patch with (hopefully) the portability problem DanielJ noticed fixed. Way to test? Andrew