Fixes to allow client-side and server-side use.