Tested under GCC: Working! Some small changes required.