Fixed compile errors.

Fixed various compile errors introduced by pull request #530.