Fixing warnings.
Cleanups.
Fixing issue #314.