Fixed some warnings and cleanup.