Fixed portability problems.